<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="huoyun" uri="/huoyun" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>My JSP 'announcement.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/dialog.css">
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/dialog.js"></script>
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/main.css">
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/car/css/cars-cx.css">
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/car/js/jweather-by-chengxin.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/car/js/car-tzh.js"></script>
			
		<style>
		  .displayContent{
		  	border: 1px solid #FFCF4F;
			padding: 10px;
		  }
		  .msg-list li {
    		border-bottom: 1px dashed #E1E1E1;
    		padding: 8px;
		  }
		</style>
	</head>

	<body>
		<div>
			<jsp:include page="../userAdmin/nav.jsp">
				<jsp:param value="nav_main" name="nav" />
			</jsp:include>
		</div>
		<div class="realCer">

			<!--主体部分-->
			<div class="realMain clearfix mt10">
				<!--左侧菜单-->
				<div class="realLeft" id="meunLeft">
					<jsp:include page="../userAdmin/leftMenu.jsp">
						<jsp:param value="con_nav_main" name="con_nav" />
					</jsp:include>
				</div>
				<!--中右-->
				<div class="realRight ml10">
					<!--中间-->
					<div class="realR_left">
						<div class="box">
							<div class="tit">
								<strong>公告信息</strong>
							</div>
							<div class="con" style="line-height:30px;">
								<s:if test="annPage.totalRecord!=0">
								<ul class="msg-list mt10">
									
										<s:iterator var="ann" value="annPage.objectList">
											<li>
												<input type="hidden" id="isOpen_<s:property value='#ann.id'/>" value="0"/>
												<span><a href="javascript:void(0);onclick=read(<s:property value='#ann.id'/>)"><s:property value="#ann.subject" />&nbsp;
												<huoyun:dateFormat date="${ann.addTime}" dateFormat="yyyy-MM-dd HH:mm:ss"/>
												</a></span>

											</li>
											<div id="annContent_<s:property value='#ann.id'/>" style="display:none" class="displayContent">
											
											</div>
										</s:iterator>	
									</ul>
									</s:if>
									<s:else>
										<span>暂时没有公告！</span>
									</s:else>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			function read(annId){
				var isOpen=$("#isOpen_"+annId).val();
				if(isOpen==0){
					$.ajax({
			    		type : "post",
			    		url  : "${pageContext.request.contextPath}/ann/announcementDetail.action",
			    		dataType : "html",
			    		data : {
			    			annId : annId
			    		},
			    		success : function(data)
			    		{
			    			$("#annContent_"+annId).show();
			    			$("#annContent_"+annId).css("display","block");
			    			$("#annContent_"+annId).html(data);
			    			$("#isOpen_"+annId).val(1);
			    		}
			    	});
			    	
			    	
			    }else{
			    	$("#annContent_"+annId).hide();
			    	$("#isOpen_"+annId).val(0);
			    	$("#annContent_"+annId).css("display","none");
			    }
			}
		</script>
	</body>
</html>
